Dynomotion

Group: DynoMotion Message: 12656 From: peterpan1e6 Date: 1/4/2016
Subject: KMotion running while servos are off

Hi


I have KMotion and KMotionCNC running G code happily and displaying X, Y and Z movements while the servos are off and without generating any errors - similar to running in open loop. But the encoders are working and counts are small when testing with the Step Response Screen and the servos are on.


I am trying to force an error by switching the servos off. I have tried setting the Error values under Max Limits on the Step Screen to very small values like 10 and 20. I also set the MaxFollowingError on the Config Screen to simlar values. Neither made any difference. I had hoped that the software would report an error once it sees an axis is not moving.


Has anyone had a similar experience and/or found a solution?


Regards


Group: DynoMotion Message: 12657 From: Tom Kerekes Date: 1/4/2016
Subject: Re: KMotion running while servos are off
Hi Eon,

The software will report an error if it sees the Axes are not moving properly. Setting a small Max Following Error will cause the Axis to disable on a large following error and any Axis in the Coordinate System that is disabled will halt the GCode. 

Please post your Initialization C Program that you are using to initialize your system. 

Regards
TK

On Jan 4, 2016, at 7:12 AM, eondekoker@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi


I have KMotion and KMotionCNC running G code happily and displaying X, Y and Z movements while the servos are off and without generating any errors - similar to running in open loop. But the encoders are working and counts are small when testing with the Step Response Screen and the servos are on.


I am trying to force an error by switching the servos off. I have tried setting the Error values under Max Limits on the Step Screen to very small values like 10 and 20. I also set the MaxFollowingError on the Config Screen to simlar values. Neither made any difference. I had hoped that the software would report an error once it sees an axis is not moving.


Has anyone had a similar experience and/or found a solution?


Regards


Group: DynoMotion Message: 12662 From: peterpan1e6 Date: 1/4/2016
Subject: Re: KMotion running while servos are off
Thanks Tom

Please find the script:

#include "KMotionDef.h"

// Defines axis 0, 1, 2 as simple step dir outputs
// enables them
// sets them as an xyz coordinate system for GCode

int main() 
{

ch0->InputMode=ENCODER_MODE;
ch0->OutputMode=DAC_SERVO_MODE;
ch0->Vel=4000;
ch0->Accel=8000;
ch0->Jerk=80000;
ch0->P=20;
ch0->I=0.0002;
ch0->D=150;
ch0->FFAccel=0;
ch0->FFVel=0.38;
ch0->MaxI=2000;
ch0->MaxErr=100000;
ch0->MaxOutput=10000;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=4;
ch0->InputChan1=4;
ch0->OutputChan0=0;
ch0->OutputChan1=1;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x100;
ch0->LimitSwitchNegBit=0;
ch0->LimitSwitchPosBit=0;
ch0->SoftLimitPos=1e+009;
ch0->SoftLimitNeg=-1e+009;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=2.5;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->BacklashMode=BACKLASH_OFF;
ch0->BacklashAmount=0;
ch0->BacklashRate=0;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=50;
ch0->StepperAmplitude=250;

ch0->iir[0].B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;

ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;

ch0->iir[2].B0=0.00641859;
ch0->iir[2].B1=0.0128372;
ch0->iir[2].B2=0.00641859;
ch0->iir[2].A1=1.76281;
ch0->iir[2].A2=-0.78848;


 EnableAxisDest(0,0);

ch1->InputMode=ENCODER_MODE;
ch1->OutputMode=DAC_SERVO_MODE;
ch1->Vel=4000;
ch1->Accel=8000;
ch1->Jerk=80000;
ch1->P=15;
ch1->I=1e-005;
ch1->D=200;
ch1->FFAccel=-0.001;
ch1->FFVel=0.43;
ch1->MaxI=1000;
ch1->MaxErr=100000;
ch1->MaxOutput=2000;
ch1->DeadBandGain=1;
ch1->DeadBandRange=0;
ch1->InputChan0=5;
ch1->InputChan1=6;
ch1->OutputChan0=1;
ch1->OutputChan1=0;
ch1->MasterAxis=-1;
ch1->LimitSwitchOptions=0x100;
ch1->LimitSwitchNegBit=0;
ch1->LimitSwitchPosBit=0;
ch1->SoftLimitPos=1e+009;
ch1->SoftLimitNeg=-1e+009;
ch1->InputGain0=1;
ch1->InputGain1=2;
ch1->InputOffset0=0;
ch1->InputOffset1=0;
ch1->OutputGain=1;
ch1->OutputOffset=0;
ch1->SlaveGain=1;
ch1->BacklashMode=BACKLASH_OFF;
ch1->BacklashAmount=0;
ch1->BacklashRate=0;
ch1->invDistPerCycle=1;
ch1->Lead=0;
ch1->MaxFollowingError=20;
ch1->StepperAmplitude=20;

ch1->iir[0].B0=1;
ch1->iir[0].B1=0;
ch1->iir[0].B2=0;
ch1->iir[0].A1=0;
ch1->iir[0].A2=0;

ch1->iir[1].B0=1;
ch1->iir[1].B1=0;
ch1->iir[1].B2=0;
ch1->iir[1].A1=0;
ch1->iir[1].A2=0;

ch1->iir[2].B0=0.00641907;
ch1->iir[2].B1=0.0128381;
ch1->iir[2].B2=0.00641907;
ch1->iir[2].A1=1.76294;
ch1->iir[2].A2=-0.788615;


 EnableAxisDest(1,0);

ch2->InputMode=ENCODER_MODE;
ch2->OutputMode=DAC_SERVO_MODE;
ch2->Vel=4000;
ch2->Accel=8000;
ch2->Jerk=80000;
ch2->P=12;
ch2->I=0;
ch2->D=20;
ch2->FFAccel=0;
ch2->FFVel=0.2;
ch2->MaxI=2000;
ch2->MaxErr=100000;
ch2->MaxOutput=2000;
ch2->DeadBandGain=1;
ch2->DeadBandRange=0;
ch2->InputChan0=6;
ch2->InputChan1=14;
ch2->OutputChan0=2;
ch2->OutputChan1=0;
ch2->MasterAxis=-1;
ch2->LimitSwitchOptions=0x100;
ch2->LimitSwitchNegBit=0;
ch2->LimitSwitchPosBit=0;
ch2->SoftLimitPos=1e+009;
ch2->SoftLimitNeg=-1e+009;
ch2->InputGain0=1;
ch2->InputGain1=1;
ch2->InputOffset0=0;
ch2->InputOffset1=0;
ch2->OutputGain=1;
ch2->OutputOffset=0;
ch2->SlaveGain=1;
ch2->BacklashMode=BACKLASH_OFF;
ch2->BacklashAmount=0;
ch2->BacklashRate=0;
ch2->invDistPerCycle=1;
ch2->Lead=0;
ch2->MaxFollowingError=20;
ch2->StepperAmplitude=20;

ch2->iir[0].B0=1;
ch2->iir[0].B1=0;
ch2->iir[0].B2=0;
ch2->iir[0].A1=0;
ch2->iir[0].A2=0;

ch2->iir[1].B0=1;
ch2->iir[1].B1=0;
ch2->iir[1].B2=0;
ch2->iir[1].A1=0;
ch2->iir[1].A2=0;

ch2->iir[2].B0=0.0166094;
ch2->iir[2].B1=0.0332189;
ch2->iir[2].B2=0.0166094;
ch2->iir[2].A1=1.60679;
ch2->iir[2].A2=-0.673229;

EnableAxisDest(2,0);


ch0->OutputOffset=2;

EnableAxisDest(0,0);
ch1->OutputOffset=-8;
EnableAxisDest(1,0);
ch2->OutputOffset=-7;
EnableAxisDest(2,0);

DefineCoordSystem(0,1,2,-1);
Delay_sec(2);
SetBit(152);
    return 0;
}

The SetBit(152) is to pull a relay to allow the servos to start.

Group: DynoMotion Message: 12663 From: peterpan1e6 Date: 1/4/2016
Subject: Re: KMotion running while servos are off
Thanks Tom

I am trying to force the system to generate the error but nothing is happening. Here is the initialisation script:

#include "KMotionDef.h"

// Defines axis 0, 1, 2 as simple step dir outputs
// enables them
// sets them as an xyz coordinate system for GCode

int main() 
{

ch0->InputMode=ENCODER_MODE;
ch0->OutputMode=DAC_SERVO_MODE;
ch0->Vel=4000;
ch0->Accel=8000;
ch0->Jerk=80000;
ch0->P=20;
ch0->I=0.0002;
ch0->D=150;
ch0->FFAccel=0;
ch0->FFVel=0.38;
ch0->MaxI=2000;
ch0->MaxErr=100000;
ch0->MaxOutput=10000;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=4;
ch0->InputChan1=4;
ch0->OutputChan0=0;
ch0->OutputChan1=1;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x100;
ch0->LimitSwitchNegBit=0;
ch0->LimitSwitchPosBit=0;
ch0->SoftLimitPos=1e+009;
ch0->SoftLimitNeg=-1e+009;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=2.5;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->BacklashMode=BACKLASH_OFF;
ch0->BacklashAmount=0;
ch0->BacklashRate=0;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=50;
ch0->StepperAmplitude=250;

ch0->iir[0].B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;

ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;

ch0->iir[2].B0=0.00641859;
ch0->iir[2].B1=0.0128372;
ch0->iir[2].B2=0.00641859;
ch0->iir[2].A1=1.76281;
ch0->iir[2].A2=-0.78848;


 EnableAxisDest(0,0);

ch1->InputMode=ENCODER_MODE;
ch1->OutputMode=DAC_SERVO_MODE;
ch1->Vel=4000;
ch1->Accel=8000;
ch1->Jerk=80000;
ch1->P=15;
ch1->I=1e-005;
ch1->D=200;
ch1->FFAccel=-0.001;
ch1->FFVel=0.43;
ch1->MaxI=1000;
ch1->MaxErr=100000;
ch1->MaxOutput=2000;
ch1->DeadBandGain=1;
ch1->DeadBandRange=0;
ch1->InputChan0=5;
ch1->InputChan1=6;
ch1->OutputChan0=1;
ch1->OutputChan1=0;
ch1->MasterAxis=-1;
ch1->LimitSwitchOptions=0x100;
ch1->LimitSwitchNegBit=0;
ch1->LimitSwitchPosBit=0;
ch1->SoftLimitPos=1e+009;
ch1->SoftLimitNeg=-1e+009;
ch1->InputGain0=1;
ch1->InputGain1=2;
ch1->InputOffset0=0;
ch1->InputOffset1=0;
ch1->OutputGain=1;
ch1->OutputOffset=0;
ch1->SlaveGain=1;
ch1->BacklashMode=BACKLASH_OFF;
ch1->BacklashAmount=0;
ch1->BacklashRate=0;
ch1->invDistPerCycle=1;
ch1->Lead=0;
ch1->MaxFollowingError=20;
ch1->StepperAmplitude=20;

ch1->iir[0].B0=1;
ch1->iir[0].B1=0;
ch1->iir[0].B2=0;
ch1->iir[0].A1=0;
ch1->iir[0].A2=0;

ch1->iir[1].B0=1;
ch1->iir[1].B1=0;
ch1->iir[1].B2=0;
ch1->iir[1].A1=0;
ch1->iir[1].A2=0;

ch1->iir[2].B0=0.00641907;
ch1->iir[2].B1=0.0128381;
ch1->iir[2].B2=0.00641907;
ch1->iir[2].A1=1.76294;
ch1->iir[2].A2=-0.788615;


 EnableAxisDest(1,0);

ch2->InputMode=ENCODER_MODE;
ch2->OutputMode=DAC_SERVO_MODE;
ch2->Vel=4000;
ch2->Accel=8000;
ch2->Jerk=80000;
ch2->P=12;
ch2->I=0;
ch2->D=20;
ch2->FFAccel=0;
ch2->FFVel=0.2;
ch2->MaxI=2000;
ch2->MaxErr=100000;
ch2->MaxOutput=2000;
ch2->DeadBandGain=1;
ch2->DeadBandRange=0;
ch2->InputChan0=6;
ch2->InputChan1=14;
ch2->OutputChan0=2;
ch2->OutputChan1=0;
ch2->MasterAxis=-1;
ch2->LimitSwitchOptions=0x100;
ch2->LimitSwitchNegBit=0;
ch2->LimitSwitchPosBit=0;
ch2->SoftLimitPos=1e+009;
ch2->SoftLimitNeg=-1e+009;
ch2->InputGain0=1;
ch2->InputGain1=1;
ch2->InputOffset0=0;
ch2->InputOffset1=0;
ch2->OutputGain=1;
ch2->OutputOffset=0;
ch2->SlaveGain=1;
ch2->BacklashMode=BACKLASH_OFF;
ch2->BacklashAmount=0;
ch2->BacklashRate=0;
ch2->invDistPerCycle=1;
ch2->Lead=0;
ch2->MaxFollowingError=20;
ch2->StepperAmplitude=20;

ch2->iir[0].B0=1;
ch2->iir[0].B1=0;
ch2->iir[0].B2=0;
ch2->iir[0].A1=0;
ch2->iir[0].A2=0;

ch2->iir[1].B0=1;
ch2->iir[1].B1=0;
ch2->iir[1].B2=0;
ch2->iir[1].A1=0;
ch2->iir[1].A2=0;

ch2->iir[2].B0=0.0166094;
ch2->iir[2].B1=0.0332189;
ch2->iir[2].B2=0.0166094;
ch2->iir[2].A1=1.60679;
ch2->iir[2].A2=-0.673229;

EnableAxisDest(2,0);


ch0->OutputOffset=2;

EnableAxisDest(0,0);
ch1->OutputOffset=-8;
EnableAxisDest(1,0);
ch2->OutputOffset=-7;
EnableAxisDest(2,0);

DefineCoordSystem(0,1,2,-1);
Delay_sec(2);
SetBit(152);
    return 0;
}

The SetBit(152) is to pull the FET switch to activate a relay which allows the servos to start.
Group: DynoMotion Message: 12670 From: Tom Kerekes Date: 1/5/2016
Subject: Re: KMotion running while servos are off
Hi Eon,

The Initialization C Program looks correct to me. 

Do you have it assigned to a User Button in KMotionCNC and are you pushing the button to execute it?

Please post a screen capture of your KMotionCNC Tool Setup Trajectory Planner Screen. 

Regards
TK

On Jan 4, 2016, at 9:42 PM, eondekoker@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Thanks Tom


I am trying to force the system to generate the error but nothing is happening. Here is the initialisation script:

#include "KMotionDef.h"

// Defines axis 0, 1, 2 as simple step dir outputs
// enables them
// sets them as an xyz coordinate system for GCode

int main() 
{

ch0->InputMode=ENCODER_MODE;
ch0->OutputMode=DAC_SERVO_MODE;
ch0->Vel=4000;
ch0->Accel=8000;
ch0->Jerk=80000;
ch0->P=20;
ch0->I=0.0002;
ch0->D=150;
ch0->FFAccel=0;
ch0->FFVel=0.38;
ch0->MaxI=2000;
ch0->MaxErr=100000;
ch0->MaxOutput=10000;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=4;
ch0->InputChan1=4;
ch0->OutputChan0=0;
ch0->OutputChan1=1;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x100;
ch0->LimitSwitchNegBit=0;
ch0->LimitSwitchPosBit=0;
ch0->SoftLimitPos=1e+009;
ch0->SoftLimitNeg=-1e+009;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=2.5;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->BacklashMode=BACKLASH_OFF;
ch0->BacklashAmount=0;
ch0->BacklashRate=0;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=50;
ch0->StepperAmplitude=250;

ch0->iir[0].B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;

ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;

ch0->iir[2].B0=0.00641859;
ch0->iir[2].B1=0.0128372;
ch0->iir[2].B2=0.00641859;
ch0->iir[2].A1=1.76281;
ch0->iir[2].A2=-0.78848;


 EnableAxisDest(0,0);

ch1->InputMode=ENCODER_MODE;
ch1->OutputMode=DAC_SERVO_MODE;
ch1->Vel=4000;
ch1->Accel=8000;
ch1->Jerk=80000;
ch1->P=15;
ch1->I=1e-005;
ch1->D=200;
ch1->FFAccel=-0.001;
ch1->FFVel=0.43;
ch1->MaxI=1000;
ch1->MaxErr=100000;
ch1->MaxOutput=2000;
ch1->DeadBandGain=1;
ch1->DeadBandRange=0;
ch1->InputChan0=5;
ch1->InputChan1=6;
ch1->OutputChan0=1;
ch1->OutputChan1=0;
ch1->MasterAxis=-1;
ch1->LimitSwitchOptions=0x100;
ch1->LimitSwitchNegBit=0;
ch1->LimitSwitchPosBit=0;
ch1->SoftLimitPos=1e+009;
ch1->SoftLimitNeg=-1e+009;
ch1->InputGain0=1;
ch1->InputGain1=2;
ch1->InputOffset0=0;
ch1->InputOffset1=0;
ch1->OutputGain=1;
ch1->OutputOffset=0;
ch1->SlaveGain=1;
ch1->BacklashMode=BACKLASH_OFF;
ch1->BacklashAmount=0;
ch1->BacklashRate=0;
ch1->invDistPerCycle=1;
ch1->Lead=0;
ch1->MaxFollowingError=20;
ch1->StepperAmplitude=20;

ch1->iir[0].B0=1;
ch1->iir[0].B1=0;
ch1->iir[0].B2=0;
ch1->iir[0].A1=0;
ch1->iir[0].A2=0;

ch1->iir[1].B0=1;
ch1->iir[1].B1=0;
ch1->iir[1].B2=0;
ch1->iir[1].A1=0;
ch1->iir[1].A2=0;

ch1->iir[2].B0=0.00641907;
ch1->iir[2].B1=0.0128381;
ch1->iir[2].B2=0.00641907;
ch1->iir[2].A1=1.76294;
ch1->iir[2].A2=-0.788615;


 EnableAxisDest(1,0);

ch2->InputMode=ENCODER_MODE;
ch2->OutputMode=DAC_SERVO_MODE;
ch2->Vel=4000;
ch2->Accel=8000;
ch2->Jerk=80000;
ch2->P=12;
ch2->I=0;
ch2->D=20;
ch2->FFAccel=0;
ch2->FFVel=0.2;
ch2->MaxI=2000;
ch2->MaxErr=100000;
ch2->MaxOutput=2000;
ch2->DeadBandGain=1;
ch2->DeadBandRange=0;
ch2->InputChan0=6;
ch2->InputChan1=14;
ch2->OutputChan0=2;
ch2->OutputChan1=0;
ch2->MasterAxis=-1;
ch2->LimitSwitchOptions=0x100;
ch2->LimitSwitchNegBit=0;
ch2->LimitSwitchPosBit=0;
ch2->SoftLimitPos=1e+009;
ch2->SoftLimitNeg=-1e+009;
ch2->InputGain0=1;
ch2->InputGain1=1;
ch2->InputOffset0=0;
ch2->InputOffset1=0;
ch2->OutputGain=1;
ch2->OutputOffset=0;
ch2->SlaveGain=1;
ch2->BacklashMode=BACKLASH_OFF;
ch2->BacklashAmount=0;
ch2->BacklashRate=0;
ch2->invDistPerCycle=1;
ch2->Lead=0;
ch2->MaxFollowingError=20;
ch2->StepperAmplitude=20;

ch2->iir[0].B0=1;
ch2->iir[0].B1=0;
ch2->iir[0].B2=0;
ch2->iir[0].A1=0;
ch2->iir[0].A2=0;

ch2->iir[1].B0=1;
ch2->iir[1].B1=0;
ch2->iir[1].B2=0;
ch2->iir[1].A1=0;
ch2->iir[1].A2=0;

ch2->iir[2].B0=0.0166094;
ch2->iir[2].B1=0.0332189;
ch2->iir[2].B2=0.0166094;
ch2->iir[2].A1=1.60679;
ch2->iir[2].A2=-0.673229;

EnableAxisDest(2,0);


ch0->OutputOffset=2;

EnableAxisDest(0,0);
ch1->OutputOffset=-8;
EnableAxisDest(1,0);
ch2->OutputOffset=-7;
EnableAxisDest(2,0);

DefineCoordSystem(0,1,2,-1);
Delay_sec(2);
SetBit(152);
    return 0;
}

The SetBit(152) is to pull the FET switch to activate a relay which allows the servos to start.

Group: DynoMotion Message: 12671 From: Eon deKoker Date: 1/5/2016
Subject: Re: KMotion running while servos are off
Attachments :
    Hi Tom

    The Initialisation program runs in Thread 1 and is started by pushing the INIT button. Here is the screen capture of the Trajectory screen.

    Inline image 1



    On Tue, Jan 5, 2016 at 7:43 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
     

    Hi Eon,

    The Initialization C Program looks correct to me. 

    Do you have it assigned to a User Button in KMotionCNC and are you pushing the button to execute it?

    Please post a screen capture of your KMotionCNC Tool Setup Trajectory Planner Screen. 

    Regards
    TK

    On Jan 4, 2016, at 9:42 PM, eondekoker@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

     

    Thanks Tom


    I am trying to force the system to generate the error but nothing is happening. Here is the initialisation script:

    #include "KMotionDef.h"

    // Defines axis 0, 1, 2 as simple step dir outputs
    // enables them
    // sets them as an xyz coordinate system for GCode

    int main() 
    {

    ch0->InputMode=ENCODER_MODE;
    ch0->OutputMode=DAC_SERVO_MODE;
    ch0->Vel=4000;
    ch0->Accel=8000;
    ch0->Jerk=80000;
    ch0->P=20;
    ch0->I=0.0002;
    ch0->D=150;
    ch0->FFAccel=0;
    ch0->FFVel=0.38;
    ch0->MaxI=2000;
    ch0->MaxErr=100000;
    ch0->MaxOutput=10000;
    ch0->DeadBandGain=1;
    ch0->DeadBandRange=0;
    ch0->InputChan0=4;
    ch0->InputChan1=4;
    ch0->OutputChan0=0;
    ch0->OutputChan1=1;
    ch0->MasterAxis=-1;
    ch0->LimitSwitchOptions=0x100;
    ch0->LimitSwitchNegBit=0;
    ch0->LimitSwitchPosBit=0;
    ch0->SoftLimitPos=1e+009;
    ch0->SoftLimitNeg=-1e+009;
    ch0->InputGain0=1;
    ch0->InputGain1=1;
    ch0->InputOffset0=0;
    ch0->InputOffset1=2.5;
    ch0->OutputGain=1;
    ch0->OutputOffset=0;
    ch0->SlaveGain=1;
    ch0->BacklashMode=BACKLASH_OFF;
    ch0->BacklashAmount=0;
    ch0->BacklashRate=0;
    ch0->invDistPerCycle=1;
    ch0->Lead=0;
    ch0->MaxFollowingError=50;
    ch0->StepperAmplitude=250;

    ch0->iir[0].B0=1;
    ch0->iir[0].B1=0;
    ch0->iir[0].B2=0;
    ch0->iir[0].A1=0;
    ch0->iir[0].A2=0;

    ch0->iir[1].B0=1;
    ch0->iir[1].B1=0;
    ch0->iir[1].B2=0;
    ch0->iir[1].A1=0;
    ch0->iir[1].A2=0;

    ch0->iir[2].B0=0.00641859;
    ch0->iir[2].B1=0.0128372;
    ch0->iir[2].B2=0.00641859;
    ch0->iir[2].A1=1.76281;
    ch0->iir[2].A2=-0.78848;


     EnableAxisDest(0,0);

    ch1->InputMode=ENCODER_MODE;
    ch1->OutputMode=DAC_SERVO_MODE;
    ch1->Vel=4000;
    ch1->Accel=8000;
    ch1->Jerk=80000;
    ch1->P=15;
    ch1->I=1e-005;
    ch1->D=200;
    ch1->FFAccel=-0.001;
    ch1->FFVel=0.43;
    ch1->MaxI=1000;
    ch1->MaxErr=100000;
    ch1->MaxOutput=2000;
    ch1->DeadBandGain=1;
    ch1->DeadBandRange=0;
    ch1->InputChan0=5;
    ch1->InputChan1=6;
    ch1->OutputChan0=1;
    ch1->OutputChan1=0;
    ch1->MasterAxis=-1;
    ch1->LimitSwitchOptions=0x100;
    ch1->LimitSwitchNegBit=0;
    ch1->LimitSwitchPosBit=0;
    ch1->SoftLimitPos=1e+009;
    ch1->SoftLimitNeg=-1e+009;
    ch1->InputGain0=1;
    ch1->InputGain1=2;
    ch1->InputOffset0=0;
    ch1->InputOffset1=0;
    ch1->OutputGain=1;
    ch1->OutputOffset=0;
    ch1->SlaveGain=1;
    ch1->BacklashMode=BACKLASH_OFF;
    ch1->BacklashAmount=0;
    ch1->BacklashRate=0;
    ch1->invDistPerCycle=1;
    ch1->Lead=0;
    ch1->MaxFollowingError=20;
    ch1->StepperAmplitude=20;

    ch1->iir[0].B0=1;
    ch1->iir[0].B1=0;
    ch1->iir[0].B2=0;
    ch1->iir[0].A1=0;
    ch1->iir[0].A2=0;

    ch1->iir[1].B0=1;
    ch1->iir[1].B1=0;
    ch1->iir[1].B2=0;
    ch1->iir[1].A1=0;
    ch1->iir[1].A2=0;

    ch1->iir[2].B0=0.00641907;
    ch1->iir[2].B1=0.0128381;
    ch1->iir[2].B2=0.00641907;
    ch1->iir[2].A1=1.76294;
    ch1->iir[2].A2=-0.788615;


     EnableAxisDest(1,0);

    ch2->InputMode=ENCODER_MODE;
    ch2->OutputMode=DAC_SERVO_MODE;
    ch2->Vel=4000;
    ch2->Accel=8000;
    ch2->Jerk=80000;
    ch2->P=12;
    ch2->I=0;
    ch2->D=20;
    ch2->FFAccel=0;
    ch2->FFVel=0.2;
    ch2->MaxI=2000;
    ch2->MaxErr=100000;
    ch2->MaxOutput=2000;
    ch2->DeadBandGain=1;
    ch2->DeadBandRange=0;
    ch2->InputChan0=6;
    ch2->InputChan1=14;
    ch2->OutputChan0=2;
    ch2->OutputChan1=0;
    ch2->MasterAxis=-1;
    ch2->LimitSwitchOptions=0x100;
    ch2->LimitSwitchNegBit=0;
    ch2->LimitSwitchPosBit=0;
    ch2->SoftLimitPos=1e+009;
    ch2->SoftLimitNeg=-1e+009;
    ch2->InputGain0=1;
    ch2->InputGain1=1;
    ch2->InputOffset0=0;
    ch2->InputOffset1=0;
    ch2->OutputGain=1;
    ch2->OutputOffset=0;
    ch2->SlaveGain=1;
    ch2->BacklashMode=BACKLASH_OFF;
    ch2->BacklashAmount=0;
    ch2->BacklashRate=0;
    ch2->invDistPerCycle=1;
    ch2->Lead=0;
    ch2->MaxFollowingError=20;
    ch2->StepperAmplitude=20;

    ch2->iir[0].B0=1;
    ch2->iir[0].B1=0;
    ch2->iir[0].B2=0;
    ch2->iir[0].A1=0;
    ch2->iir[0].A2=0;

    ch2->iir[1].B0=1;
    ch2->iir[1].B1=0;
    ch2->iir[1].B2=0;
    ch2->iir[1].A1=0;
    ch2->iir[1].A2=0;

    ch2->iir[2].B0=0.0166094;
    ch2->iir[2].B1=0.0332189;
    ch2->iir[2].B2=0.0166094;
    ch2->iir[2].A1=1.60679;
    ch2->iir[2].A2=-0.673229;

    EnableAxisDest(2,0);


    ch0->OutputOffset=2;

    EnableAxisDest(0,0);
    ch1->OutputOffset=-8;
    EnableAxisDest(1,0);
    ch2->OutputOffset=-7;
    EnableAxisDest(2,0);

    DefineCoordSystem(0,1,2,-1);
    Delay_sec(2);
    SetBit(152);
        return 0;
    }

    The SetBit(152) is to pull the FET switch to activate a relay which allows the servos to start.


    Group: DynoMotion Message: 12672 From: Eon deKoker Date: 1/5/2016
    Subject: Re: KMotion running while servos are off
    Attachments :
      Thanks Tom for your patience. I eventually found the problem. The INIT button pointed to a Config file in another directory. So I was making changes in one file while running another file with the same name in a different directory. That file had MaxFollowingError set to the default value.

      On Tue, Jan 5, 2016 at 7:53 PM, Eon deKoker <eondekoker@...> wrote:
      Hi Tom

      The Initialisation program runs in Thread 1 and is started by pushing the INIT button. Here is the screen capture of the Trajectory screen.

      Inline image 1



      On Tue, Jan 5, 2016 at 7:43 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
       

      Hi Eon,

      The Initialization C Program looks correct to me. 

      Do you have it assigned to a User Button in KMotionCNC and are you pushing the button to execute it?

      Please post a screen capture of your KMotionCNC Tool Setup Trajectory Planner Screen. 

      Regards
      TK

      On Jan 4, 2016, at 9:42 PM, eondekoker@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

       

      Thanks Tom


      I am trying to force the system to generate the error but nothing is happening. Here is the initialisation script:

      #include "KMotionDef.h"

      // Defines axis 0, 1, 2 as simple step dir outputs
      // enables them
      // sets them as an xyz coordinate system for GCode

      int main() 
      {

      ch0->InputMode=ENCODER_MODE;
      ch0->OutputMode=DAC_SERVO_MODE;
      ch0->Vel=4000;
      ch0->Accel=8000;
      ch0->Jerk=80000;
      ch0->P=20;
      ch0->I=0.0002;
      ch0->D=150;
      ch0->FFAccel=0;
      ch0->FFVel=0.38;
      ch0->MaxI=2000;
      ch0->MaxErr=100000;
      ch0->MaxOutput=10000;
      ch0->DeadBandGain=1;
      ch0->DeadBandRange=0;
      ch0->InputChan0=4;
      ch0->InputChan1=4;
      ch0->OutputChan0=0;
      ch0->OutputChan1=1;
      ch0->MasterAxis=-1;
      ch0->LimitSwitchOptions=0x100;
      ch0->LimitSwitchNegBit=0;
      ch0->LimitSwitchPosBit=0;
      ch0->SoftLimitPos=1e+009;
      ch0->SoftLimitNeg=-1e+009;
      ch0->InputGain0=1;
      ch0->InputGain1=1;
      ch0->InputOffset0=0;
      ch0->InputOffset1=2.5;
      ch0->OutputGain=1;
      ch0->OutputOffset=0;
      ch0->SlaveGain=1;
      ch0->BacklashMode=BACKLASH_OFF;
      ch0->BacklashAmount=0;
      ch0->BacklashRate=0;
      ch0->invDistPerCycle=1;
      ch0->Lead=0;
      ch0->MaxFollowingError=50;
      ch0->StepperAmplitude=250;

      ch0->iir[0].B0=1;
      ch0->iir[0].B1=0;
      ch0->iir[0].B2=0;
      ch0->iir[0].A1=0;
      ch0->iir[0].A2=0;

      ch0->iir[1].B0=1;
      ch0->iir[1].B1=0;
      ch0->iir[1].B2=0;
      ch0->iir[1].A1=0;
      ch0->iir[1].A2=0;

      ch0->iir[2].B0=0.00641859;
      ch0->iir[2].B1=0.0128372;
      ch0->iir[2].B2=0.00641859;
      ch0->iir[2].A1=1.76281;
      ch0->iir[2].A2=-0.78848;


       EnableAxisDest(0,0);

      ch1->InputMode=ENCODER_MODE;
      ch1->OutputMode=DAC_SERVO_MODE;
      ch1->Vel=4000;
      ch1->Accel=8000;
      ch1->Jerk=80000;
      ch1->P=15;
      ch1->I=1e-005;
      ch1->D=200;
      ch1->FFAccel=-0.001;
      ch1->FFVel=0.43;
      ch1->MaxI=1000;
      ch1->MaxErr=100000;
      ch1->MaxOutput=2000;
      ch1->DeadBandGain=1;
      ch1->DeadBandRange=0;
      ch1->InputChan0=5;
      ch1->InputChan1=6;
      ch1->OutputChan0=1;
      ch1->OutputChan1=0;
      ch1->MasterAxis=-1;
      ch1->LimitSwitchOptions=0x100;
      ch1->LimitSwitchNegBit=0;
      ch1->LimitSwitchPosBit=0;
      ch1->SoftLimitPos=1e+009;
      ch1->SoftLimitNeg=-1e+009;
      ch1->InputGain0=1;
      ch1->InputGain1=2;
      ch1->InputOffset0=0;
      ch1->InputOffset1=0;
      ch1->OutputGain=1;
      ch1->OutputOffset=0;
      ch1->SlaveGain=1;
      ch1->BacklashMode=BACKLASH_OFF;
      ch1->BacklashAmount=0;
      ch1->BacklashRate=0;
      ch1->invDistPerCycle=1;
      ch1->Lead=0;
      ch1->MaxFollowingError=20;
      ch1->StepperAmplitude=20;

      ch1->iir[0].B0=1;
      ch1->iir[0].B1=0;
      ch1->iir[0].B2=0;
      ch1->iir[0].A1=0;
      ch1->iir[0].A2=0;

      ch1->iir[1].B0=1;
      ch1->iir[1].B1=0;
      ch1->iir[1].B2=0;
      ch1->iir[1].A1=0;
      ch1->iir[1].A2=0;

      ch1->iir[2].B0=0.00641907;
      ch1->iir[2].B1=0.0128381;
      ch1->iir[2].B2=0.00641907;
      ch1->iir[2].A1=1.76294;
      ch1->iir[2].A2=-0.788615;


       EnableAxisDest(1,0);

      ch2->InputMode=ENCODER_MODE;
      ch2->OutputMode=DAC_SERVO_MODE;
      ch2->Vel=4000;
      ch2->Accel=8000;
      ch2->Jerk=80000;
      ch2->P=12;
      ch2->I=0;
      ch2->D=20;
      ch2->FFAccel=0;
      ch2->FFVel=0.2;
      ch2->MaxI=2000;
      ch2->MaxErr=100000;
      ch2->MaxOutput=2000;
      ch2->DeadBandGain=1;
      ch2->DeadBandRange=0;
      ch2->InputChan0=6;
      ch2->InputChan1=14;
      ch2->OutputChan0=2;
      ch2->OutputChan1=0;
      ch2->MasterAxis=-1;
      ch2->LimitSwitchOptions=0x100;
      ch2->LimitSwitchNegBit=0;
      ch2->LimitSwitchPosBit=0;
      ch2->SoftLimitPos=1e+009;
      ch2->SoftLimitNeg=-1e+009;
      ch2->InputGain0=1;
      ch2->InputGain1=1;
      ch2->InputOffset0=0;
      ch2->InputOffset1=0;
      ch2->OutputGain=1;
      ch2->OutputOffset=0;
      ch2->SlaveGain=1;
      ch2->BacklashMode=BACKLASH_OFF;
      ch2->BacklashAmount=0;
      ch2->BacklashRate=0;
      ch2->invDistPerCycle=1;
      ch2->Lead=0;
      ch2->MaxFollowingError=20;
      ch2->StepperAmplitude=20;

      ch2->iir[0].B0=1;
      ch2->iir[0].B1=0;
      ch2->iir[0].B2=0;
      ch2->iir[0].A1=0;
      ch2->iir[0].A2=0;

      ch2->iir[1].B0=1;
      ch2->iir[1].B1=0;
      ch2->iir[1].B2=0;
      ch2->iir[1].A1=0;
      ch2->iir[1].A2=0;

      ch2->iir[2].B0=0.0166094;
      ch2->iir[2].B1=0.0332189;
      ch2->iir[2].B2=0.0166094;
      ch2->iir[2].A1=1.60679;
      ch2->iir[2].A2=-0.673229;

      EnableAxisDest(2,0);


      ch0->OutputOffset=2;

      EnableAxisDest(0,0);
      ch1->OutputOffset=-8;
      EnableAxisDest(1,0);
      ch2->OutputOffset=-7;
      EnableAxisDest(2,0);

      DefineCoordSystem(0,1,2,-1);
      Delay_sec(2);
      SetBit(152);
          return 0;
      }

      The SetBit(152) is to pull the FET switch to activate a relay which allows the servos to start.